<template>
  <div class="qin-home">
    <!--<x-header style="background-color:#91d047;" :left-options="{showBack: false}">亲青筹</x-header>-->
    <div class="head-count">
      <div class="logo">
        <!--<img class="" src="../images/logo.png" alt="">-->
        <img class="logoone" src="../images/logo01.png" alt="">
        <img class="logotwo" src="../images/logo02.png" alt="">
      </div>
      <div class="count">
        <span class="count-money">元</span>
        <ul>
          <countup :start-val="0.00" :end-val="totalMoneys" :duration="1" class="demo1" :decimals="2"></countup>
          <!--<li v-for="totalMoneyA in totalMoney" v-bind:class="{'xiaoshudian': totalMoneyA == '.'}">{{totalMoneyA}}</li>-->
          <!--<li v-for="totalMoneyA in totalMoney">{{totalMoneyA}}</li>-->
        </ul>
        <span>累计捐款</span>
      </div>
      <div class="count-text">
        共青团浙江省委官方主办
      </div>
    </div>
    <div class="fourTab">
      <ul>
        <router-link to="/batch">
          <li>
            <div class="fourTab-listOne">
              <img src="../images/piliangjuan.png" alt=""> <span>批量捐助</span>
            </div>
          </li>
        </router-link>
        <router-link :to="{path: '/dkbf'}">
          <li>
            <div class="fourTab-listOne">
              <img src="../images/myDonation.png" alt=""> <span>对口帮扶</span>
            </div>
          </li>
        </router-link>
        <router-link to="/oneToOneList">
          <li>
            <div class="fourTab-listOne">
              <img src="../images/yiduiyijuanzhu.png" alt=""> <span>一对一捐助</span>
            </div>
          </li>
        </router-link>
        <router-link to="/everyDayKind">
          <li>
            <div class="fourTab-listOne">
              <img src="../images/meiriyijuan.png" alt=""> <span>日行一善</span>
            </div>
          </li>
        </router-link>
      </ul>
    </div>
    <!--轮播图部分-->
    <div class="head-main">
      <swiper :aspect-ratio="300/800" auto loop>
        <swiper-item class="swiper-demo-img" v-for="(item, index) in imglist" :key="index">
          <!--@click="goProject('imgOne')"-->
          <img v-if="item.carouselPicUrl == ''" src="../images/head-li.png" alt="">
          <img v-else :src="imageUrl.imageUrl + item.carouselPicUrl" @click="goProject(item.carouselUrl, 'lunbo')">
        </swiper-item>
      </swiper>
      <div class="head-search">
        <div class="search" @click="goSearchProject('')"><i class="iconfont">&#xe638;</i>查询公益项目</div>
        <div class="bale">
          <span @click="goSearchPage('medicine')">#助医</span>
          <span @click="goSearchPage('study')">#助学</span>
          <span @click="goSearchPage('pool')">#助困</span>
        </div>
      </div>
    </div>
    <!--推荐部分-->
    <!--<div v-finger:press-move="pressMove">-->
      <!--<scroller lock-y  ref="scroller" :scrollbar-x=false style="background-color: #f4f4f4" :pullupStatus="pullupStatus" disablePullup>-->
        <!--<div class="content-box" :style="{width: widthSc + 'px'}" >-->
          <!--<div class="content">-->
            <!--<div class="content-left float-left" v-for="eventLists in eventList" @click="goProject(eventLists.id)">-->
              <!--<div class="content-left-img img-right">-->
                <!--<img :src="imageUrl.imageUrl + eventLists.eventPicUrl"/>-->
              <!--</div>-->
              <!--<p v-html="eventLists.eventName"></p>-->
              <!--<div class="content-progress">-->
                <!--<x-progress class="progresss" :percent="eventLists.schedule" :show-cancel="false"></x-progress>-->
                <!--<span class="progress-right">{{eventLists.schedule}}%</span>-->
              <!--</div>-->
              <!--&lt;!&ndash;<div class="content-foot">&ndash;&gt;-->
              <!--&lt;!&ndash;<span class="content-foot-left">我要捐款</span>&ndash;&gt;-->
              <!--&lt;!&ndash;<span class="content-foot-right">邀朋友一起捐</span>&ndash;&gt;-->
              <!--&lt;!&ndash;</div>&ndash;&gt;-->
            <!--</div>-->
          <!--</div>-->
        <!--</div>-->
      <!--</scroller>-->
    <!--</div>-->
    <div class="tuijian">
      <div class="content-box" :style="{width: widthSc + 'px'}" >
        <div class="content">
          <div class="content-left float-left" v-for="eventLists in eventList" @click="goProject(eventLists.id,null,eventLists.isTh)">
            <div class="content-left-img img-right">
              <img :src="imageUrl.imageUrl + eventLists.eventPicUrl"/>
            </div>
            <p v-html="eventLists.eventName"></p>
            <div class="content-progress">
              <x-progress class="progresss" :percent="eventLists.schedule" :show-cancel="false"></x-progress>
              <span class="progress-right">{{eventLists.schedule}}%</span>
            </div>
            <!--<div class="content-foot">-->
            <!--<span class="content-foot-left">我要捐款</span>-->
            <!--<span class="content-foot-right">邀朋友一起捐</span>-->
            <!--</div>-->
          </div>
        </div>
      </div>

    </div>


    <!--<div class="home-list">-->
    <!--<ul>-->
    <!--<li>-->
    <!--<i class="iconfont" v-if="quanbu === true" @click="changeProjectType('quanbu')">&#xe602;</i>-->
    <!--<i class="iconfont" v-else @click="changeProjectType('quanbu')">&#xe604;</i>-->
    <!--&lt;!&ndash;604&ndash;&gt;-->
    <!--<p>全部</p>-->
    <!--</li>-->
    <!--<li>-->
    <!--<i class="iconfont" v-if="zhukun === true" @click="changeProjectType('zhukun')">&#xe60a;</i>-->
    <!--<i class="iconfont" v-else @click="changeProjectType('zhukun')">&#xe60b;</i>-->
    <!--&lt;!&ndash;60a&ndash;&gt;-->
    <!--<p>助困</p>-->
    <!--</li>-->
    <!--<li>-->
    <!--<i class="iconfont" v-if="zhuxue === true" @click="changeProjectType('zhuxue')">&#xe607;</i>-->
    <!--<i class="iconfont" v-else @click="changeProjectType('zhuxue')">&#xe609;</i>-->
    <!--&lt;!&ndash;607&ndash;&gt;-->
    <!--<p>助学</p>-->
    <!--</li>-->
    <!--<li>-->
    <!--<i class="iconfont" v-if="zhuyi === true" @click="changeProjectType('zhuyi')">&#xe606;</i>-->
    <!--<i class="iconfont" v-else @click="changeProjectType('zhuyi')">&#xe60c;</i>-->
    <!--&lt;!&ndash;606&ndash;&gt;-->
    <!--<p>助医</p>-->
    <!--</li>-->
    <!--<li>-->
    <!--<i class="iconfont" v-if="qita === true" @click="changeProjectType('qita')">&#xe603;</i>-->
    <!--<i class="iconfont" v-else @click="changeProjectType('qita')">&#xe605;</i>-->
    <!--&lt;!&ndash;603&ndash;&gt;-->
    <!--<p>其他</p>-->
    <!--</li>-->
    <!--</ul>-->
    <!--</div>-->
    <!--<div v-show="eventUser.length > 0">-->
      <!--<div class="home-once">-->
        <!--<p><i style="font-size: 26px;line-height: 29px" class="iconfont">&#xe674;</i> <span>我的近期捐助</span></p>-->
      <!--</div>-->
      <!--<div class="home-tab">-->
        <!--<div @click="goProject(eventUsers.id)" v-for="(eventUsers, index) in eventUser">-->
          <!--<flexbox>-->
            <!--<flexbox-item :span="4">-->
              <!--<div class="flex-demo">-->
                <!--<img :src="imageUrl.imageUrl + eventUsers.eventPicUrl"/>-->
              <!--</div>-->
            <!--</flexbox-item>-->
            <!--<flexbox-item>-->
              <!--<div class="flex-demo">-->
                <!--<p class="eventName"><span v-html="eventUsers.eventName"></span></p>-->
                <!--<p>-->
                  <!--<em class="lable">{{eventUsers.event_typeLable}}</em>-->
                  <!--<em class="lable" v-show="eventUsers.label1 != ''">{{eventUsers.label1}}</em>-->
                  <!--<em class="lable" v-show="eventUsers.label2 != ''">{{eventUsers.label2}}</em>-->
                  <!--<em class="lable" v-show="eventUsers.label1 == ''">爱心</em>-->
                  <!--<em class="lable" v-show="eventUsers.label2 == ''">捐助</em>-->
                <!--</p>-->
                <!--<x-progress :percent="eventUsers.schedule" :show-cancel="false"></x-progress>-->
                <!--<span class="precess-right">{{eventUsers.schedule}}%</span>-->
                <!--<div class="project-foot">-->
                <!--<span class="project-foot-left">目标<span-->
                  <!--class="content-red">{{eventUsers.eventGoalAmount}}</span>元</span>-->
                  <!--<span class="project-foot-left">参加<span-->
                    <!--class="content-red">{{eventUsers.attendPeople}}</span>人次</span>-->
                <!--</div>-->
              <!--</div>-->
            <!--</flexbox-item>-->
          <!--</flexbox>-->
        <!--</div>-->
      <!--</div>-->
    <!--</div>-->


    <div class="home-once">
      <p><i class="iconfont">&#xe65b;</i> <span>近期全部项目</span></p>
    </div>


    <div class="home-tab">
      <!--<tab :line-width=2 v-model="index">-->
      <!--<tab-item class="vux-center" :selected="demo === '近期项目'" @on-item-click="witchEvent('jinqi')">-->
      <!--<span :class="{'home-active': isA}">近期项目</span>-->
      <!--</tab-item>-->
      <!--<tab-item class="vux-center" @on-item-click="witchEvent('wangqi')">-->
      <!--<span :class="{'home-active': isB}">往期项目</span>-->
      <!--</tab-item>-->
      <!--</tab>-->
      <div @click="goProject(eventListJqs.id,null,eventListJqs.isTh)" v-for="(eventListJqs, index) in eventListQB">
        <!--<p class="listTitle" v-html="eventListJqs.eventName"></p>-->
        <flexbox>
          <flexbox-item :span="4">
            <div class="flex-demo">
              <img :src="imageUrl.imageUrl + eventListJqs.eventPicUrl"/>
            </div>
          </flexbox-item>
          <flexbox-item>
            <div class="flex-demo">
              <p class="eventName"><span v-html="eventListJqs.eventName"></span></p>
              <p>
                <em class="lable">{{eventListJqs.event_typeLable}}</em>
                <em class="lable" v-show="eventListJqs.label1 != ''">{{eventListJqs.label1}}</em>
                <em class="lable" v-show="eventListJqs.label2 != ''">{{eventListJqs.label2}}</em>
                <em class="lable" v-show="eventListJqs.label1 == ''">爱心</em>
                <em class="lable" v-show="eventListJqs.label2 == ''">捐助</em>
              </p>


              <div class="progress_box">
                <x-progress :percent="eventListJqs.schedule" :show-cancel="false"></x-progress>
                <span class="precess-right">{{eventListJqs.schedule}}%</span>
              </div>



              <div class="project-foot">
                <span class="project-foot-left">目标<span
                  class="content-red">{{eventListJqs.eventGoalAmount}}</span>元</span>
                <span class="project-foot-left">参加<span
                  class="content-red">{{eventListJqs.attendPeople}}</span>人次</span>
              </div>
            </div>
          </flexbox-item>
        </flexbox>
      </div>
      <div class="moreEvent" @click="whichGoMore()" v-model="noMoreEvent">{{noMoreEvent}}</div>
    </div>

    <div class="tabList">
      <ul>
        <li @click="goSearchPage('all')">全部项目 <i class="iconfont">&#xe61a;</i> <span>{{allNum}}</span></li>
        <li @click="goSearchPage('pool')">助困 <i class="iconfont">&#xe61a;</i> <span>{{poolNum}}</span></li>
        <li @click="goSearchPage('study')">助学 <i class="iconfont">&#xe61a;</i> <span>{{studyNum}}</span></li>
        <li @click="goSearchPage('medicine')">助医 <i class="iconfont">&#xe61a;</i> <span>{{medicineNum}}</span></li>
        <li @click="goSearchPage('other')">其它 <i class="iconfont">&#xe61a;</i> <span>{{otherNum}}</span></li>
      </ul>
    </div>

    <toast v-model="showToast" width="8.5rem" type="success" :time="2000" position="middle"><p>今日登录</p> 获得<span
      v-model="integral">{{integral}}</span>积分
    </toast>

    <div style="width: 100%;height: 80px"></div>
    <nav-bottom></nav-bottom>
  </div>
</template>

<script>
  import navBottom from './common/nav-bottom.vue';
  import './index.scss';
  import Toast from 'vux/src/components/toast/index.vue'
  import Swiper from 'vux/src/components/swiper/swiper.vue'
  import SwiperItem from 'vux/src/components/swiper/swiper-item.vue'
  import XProgress from 'vux/src/components/x-progress/index.vue'
  import Tab from 'vux/src/components/tab/tab.vue'
  import TabItem from 'vux/src/components/tab/tab-item.vue'
  import Sticky from 'vux/src/components/sticky/index.vue'
  import Flexbox from 'vux/src/components/flexbox/flexbox.vue'
  import FlexboxItem from 'vux/src/components/flexbox/flexbox-item.vue'
//  import Scroller from 'vux/src/components/scroller/index.vue'
  import Countup from 'vux/src/components/countup/index.vue'


  import CONSTANT from '@/common/constants.js'
  import http from '@/common/http.js'

  const list = () => ['近期项目', '往期项目']
  export default {
    name: 'Hello',
    data() {
      return {
        totalMoney: ["0", "0", "0", "0", "0", "0", "0", "0", ".", "0", "0",],
        totalMoneys: 0,
        imglist: [{id: "", carouselStatus: "", carouselUrl: "", carouselPicUrl: ""}, {
          id: "",
          carouselStatus: "",
          carouselUrl: "",
          carouselPicUrl: ""
        }],
        eventList: [],
//        近期捐助过的项目
        eventUser: [],
        eventListQB: [],
        eventListJq: [],
        eventListWangqi: [],
        poolListJq: [],
        poolListWangqi: [],
        studyListJq: [],
        studyListWangqi: [],
        medicineListJq: [],
        medicineListWangqi: [],
        otherListJq: [],
        otherListWangqi: [],
        pageNoJinqi: 1,
        pageNoWangqi: 1,
        allNoJinqi: 1,
        allNoWangqi: 1,
        poolNoJinqi: 1,
        poolNoWangqi: 1,
        studyNoJinqi: 1,
        studyNoWangqi: 1,
        medicineNoJinqi: 1,
        medicineNoWangqi: 1,
        otherNoJinqi: 1,
        otherNoWangqi: 1,

        noMoreEvent: '点击查看更多',

        pageSize: 15,
        event_type: '',
//        判断往期还是近期
        witchGo: 'jinqi',
        index: 0,
        demo: '近期项目',
//      tab选中时绑定的样式
        isA: true,
        isB: false,
        showToast: false,
        integral: '10',
        // 类型选择
        quanbu: true,
        zhukun: false,
        zhuxue: false,
        zhuyi: false,
        qita: false,

        userId: '',
        pullupStatus: 'disabled',

        allNum: '',
        studyNum: '',
        poolNum: '',
        medicineNum: '',
        otherNum: '',
        widthSc: ''
      }
    },
    components: {
      navBottom,
      Swiper,
      SwiperItem,
      XProgress,
      Tab,
      TabItem,
      Sticky,
      Flexbox,
      FlexboxItem,
      Toast,
//      Scroller,
      Countup
    },
    activated () {
      document.body.scrollTop = document.documentElement.scrollTop = 0;
      if (this.$emit('ShareAppMessage')) {
        this.$emit('ShareAppMessage', '亲青筹', '“亲青筹”由浙江团省委、青基会发起设立，通过众筹善款，服务青少年成长。', 'http://www.qqchou.org/a/wxinterface/wxOAuth', 'http://www.qqchou.org/userfiles/2/images/1513911875.png')
      }
    },
    mounted () {
      var openid = sessionStorage.getItem("openid");
      if (openid == null || openid == '' || openid == 'undefined') {
        window.sessionStorage.setItem('openid', this.$route.query.openId)
        window.sessionStorage.setItem('userId', this.$route.query.userId)
        window.sessionStorage.setItem('wxAvatar', this.$route.query.wxAvatar)
        window.sessionStorage.setItem('nickName', this.$route.query.nickName)
      }
      this.$emit('ifOpenid', this.$route.path)
      this.userId = window.sessionStorage.getItem('userId')
      http.post(CONSTANT.TOTAL_MONEY, {}, (res) => {
        // 累计捐款请求
        if (res.code == 200) {
          let totalMoneyArr = [];
          for (let i = 0; i < res.obj.totalMoney.length; i++) {
            let n = res.obj.totalMoney.substring(i, i + 1)
            totalMoneyArr.push(n)
          }
          this.totalMoney = totalMoneyArr;
          this.totalMoneys = res.obj.totalMoney * 1
          this.allNum = res.obj.whole
          for (let num = 0; num < res.obj.typeNumber.length; num++) {
            if (res.obj.typeNumber[num].eventType == 'medicine') {
              this.medicineNum = res.obj.typeNumber[num].number
            } else if (res.obj.typeNumber[num].eventType == 'other') {
              this.otherNum = res.obj.typeNumber[num].number
            } else if (res.obj.typeNumber[num].eventType == 'pool') {
              this.poolNum = res.obj.typeNumber[num].number
            } else if (res.obj.typeNumber[num].eventType == 'study') {
              this.studyNum = res.obj.typeNumber[num].number
            }
          }
        }
      });
      /*http.post(CONSTANT.SIGN, {userId: this.userId}, (res) => {
        if (res.code == 200) {
          if (res.errmsg == '今日已登录') {
            this.showToast = false
          } else if (res.errmsg == '首次登录成功') {
            this.showToast = true
            this.integral = res.obj.integral
          } else if (res.errmsg == '今日登录成功') {
            this.showToast = true
            this.integral = res.obj.integral
          }
        }
      })*/
      http.post(CONSTANT.CAROUSEL_LIST, {}, (res) => {
//        轮播图请求
        if (res.code == 200) {
          this.imglist = res.list;
        }
      })
//      http.post(CONSTANT.EVENT_USER, {userId: this.userId}, (res) => {
////        近期捐助的项目
//        console.log('jinqi', res)
//        if (res.code == 200) {
//          if (res.errmsg == '近期没有捐助项目') {
//            return
//          }
//          for (var i = 0; i < res.list.length; i++) {
//            if (res.list[i].eventType == 'pool') {
//              res.list[i].event_typeLable = '助困'
//            } else if (res.list[i].eventType == 'medicine') {
//              res.list[i].event_typeLable = '助医'
//            } else if (res.list[i].eventType == 'study') {
//              res.list[i].event_typeLable = '助学'
//            } else if (res.list[i].eventType == 'other') {
//              res.list[i].event_typeLable = '其它'
//            }
//          }
//          this.eventUser = res.list
//        }
//      })
      http.post(CONSTANT.EVENT_RECOMMEDN, {}, (res) => {
//        推荐项目请求
        if (res.code == 200) {
//        计算推荐项目scroll的宽度  154px 加上  margin的
          this.widthSc = res.list.length * 148
          this.$nextTick(() => {
//            this.$refs.scroller.reset()
          })
          this.eventList = res.list
        }
      })
//      近期项目请求
      this.pageNoJinqi = this.allNoJinqi;
      this.pageNoWangqi = this.allNoWangqi;
//      this.goEVENT_LISTWq();
      this.goEVENT_LIST();
    },
    methods: {
      pressMove (e) {
//        console.log(e)
        var str = 0
        var scrollTop = document.documentElement.scrollTop
        var scroll = 0
//        console.log('scroll', scrollTop)
        str = str + e.deltaY
//        console.log('deltaY', e.deltaY)
//        console.log('str', str)
        scroll = scrollTop - str
        if (scroll < 0) {
          scroll = 0
        }
        window.scrollTo(0, scroll)
      },
      goSearchPage (e) {
        this.$router.push({path: '/searchProject', query: {type: e}})
      },
      goSearchProject (e) {
        this.$router.push({path: '/searchProject', query: {gjz: e}})
      },
      goEVENT_LIST() {
        //      近期项目请求
        this.witchGo = 'jinqi';
        http.post(CONSTANT.EVENT_LIST, {
          pageNo: this.pageNoJinqi,
          pageSize: this.pageSize
        }, (res) => {
          if (res.code == 200) {
            if (res.errmsg == '没有更多的项目') {
              // this.noMoreEvent = '没有更多的项目了'
              return
            } else if (res.errmsg == '') {
              // this.noMoreEvent = '点击加载更多'
            }
            if (this.event_type == '') {
              if (this.allNoJinqi == 1) {
                for (var i = 0; i < res.list.length; i++) {
                  if (res.list[i].eventType == 'pool') {
                    res.list[i].event_typeLable = '助困'
                  } else if (res.list[i].eventType == 'medicine') {
                    res.list[i].event_typeLable = '助医'
                  } else if (res.list[i].eventType == 'study') {
                    res.list[i].event_typeLable = '助学'
                  } else if (res.list[i].eventType == 'other') {
                    res.list[i].event_typeLable = '其它'
                  }
                }
                this.eventListJq = res.list;
                this.eventListQB = this.eventListJq;
              } else {
                for (var i = 0; i < res.list.length; i++) {
                  if (res.list[i].eventType == 'pool') {
                    res.list[i].event_typeLable = '助困'
                  } else if (res.list[i].eventType == 'medicine') {
                    res.list[i].event_typeLable = '助医'
                  } else if (res.list[i].eventType == 'study') {
                    res.list[i].event_typeLable = '助学'
                  } else if (res.list[i].eventType == 'other') {
                    res.list[i].event_typeLable = '其它'
                  }
                }
                this.eventListJq = this.eventListJq.concat(res.list);
                if (this.witchGo == 'jinqi' && this.event_type == '') {
                  this.eventListQB = this.eventListJq;
                }
              }
            } else if (this.event_type == 'pool') {
              if (this.poolNoJinqi == 1) {
                this.poolListJq = res.list;
                this.poolNoJinqi++
                if (this.witchGo == 'jinqi' && this.event_type == 'pool') {
                  this.eventListQB = this.poolListJq;
                }
              } else {
                this.poolListJq = this.poolListJq.concat(res.list);
                this.poolNoJinqi++
                if (this.witchGo == 'jinqi' && this.event_type == 'pool') {
                  this.eventListQB = this.poolListJq;
                }
              }
            } else if (this.event_type == 'study') {
              if (this.studyNoJinqi == 1) {
                this.studyListJq = res.list;
                this.studyNoJinqi++;
                if (this.witchGo == 'jinqi' && this.event_type == 'study') {
                  this.eventListQB = this.studyListJq
                }
              } else {
                this.studyListJq = this.studyListJq.concat(res.list);
                this.studyNoJinqi++;
                if (this.witchGo == 'jinqi' && this.event_type == 'study') {
                  this.eventListQB = this.studyListJq
                }
              }
            } else if (this.event_type == 'medicine') {
              if (this.medicineNoJinqi == 1) {
                this.medicineListJq = res.list;
                this.medicineNoJinqi++;
                if (this.witchGo == 'jinqi' && this.event_type == 'medicine') {
                  this.eventListQB = this.medicineListJq
                }
              } else {
                this.medicineListJq = this.medicineListJq.concat(res.list);
                this.medicineNoJinqi++;
                if (this.witchGo == 'jinqi' && this.event_type == 'medicine') {
                  this.eventListQB = this.medicineListJq
                }
              }
            } else if (this.event_type == 'other') {
              if (this.otherNoJinqi == 1) {
                this.otherListJq = res.list;
                this.otherNoJinqi++;
                if (this.witchGo == 'jinqi' && this.event_type == 'other') {
                  this.eventListQB = this.otherListJq
                }
              } else {
                this.otherListJq = this.otherListJq.concat(res.list);
                this.otherNoJinqi++;
                if (this.witchGo == 'jinqi' && this.event_type == 'other') {
                  this.eventListQB = this.otherListJq
                }
              }
            }
          }
        })
      },
      goEVENT_LISTWq() {
        // 往期项目请求
        this.witchGo = 'wangqi';
        http.post(CONSTANT.EVENT_PAST, {
          event_type: this.event_type,
          pageNo: this.pageNoWangqi,
          pageSize: this.pageSize
        }, (res) => {
          if (res.code == 200) {
            if (res.errmsg == '没有更多的项目') {
              // this.noMoreEvent = '没有更多的项目了'
              return
            } else if (res.errmsg == '') {
              // this.noMoreEvent = '点击加载更多'
            }
            if (this.event_type == '') {
              if (this.allNoWangqi == 1) {
                this.eventListWangqi = res.list;
                this.allNoWangqi++
                if (this.witchGo == 'wangqi' && this.event_type == '') {
                  this.eventListQB = this.eventListWangqi;
                }
//                if (this.allNoJinqi != 1) {
//                  this.eventListQB = this.eventListWangqi;
//                }
              } else {
                this.eventListWangqi = this.eventListWangqi.concat(res.list);
                this.allNoWangqi++
                if (this.witchGo == 'wangqi' && this.event_type == '') {
                  this.eventListQB = this.eventListWangqi;
                }
              }
            } else if (this.event_type == 'pool') {
              if (this.poolNoWangqi == 1) {
                this.poolListWangqi = res.list;
                this.poolNoWangqi++
                if (this.witchGo == 'wangqi' && this.event_type == 'pool') {
                  this.eventListQB = this.poolListWangqi;
                }
              } else {
                this.poolListWangqi = this.poolListWangqi.concat(res.list);
                this.poolNoWangqi++
                if (this.witchGo == 'wangqi' && this.event_type == 'pool') {
                  this.eventListQB = this.poolListWangqi;
                }
              }
            } else if (this.event_type == 'study') {
              if (this.studyNoWangqi == 1) {
                this.studyListWangqi = res.list;
                this.studyNoWangqi++;
                if (this.witchGo == 'wangqi' && this.event_type == 'study') {
                  this.eventListQB = this.studyListWangqi
                }
              } else {
                this.studyListWangqi = this.studyListWangqi.concat(res.list);
                this.studyNoWangqi++;
                if (this.witchGo == 'wangqi' && this.event_type == 'study') {
                  this.eventListQB = this.studyListWangqi
                }
              }
            } else if (this.event_type == 'medicine') {
              if (this.medicineNoWangqi == 1) {
                this.medicineListWangqi = res.list;
                this.medicineNoWangqi++;
                if (this.witchGo == 'wangqi' && this.event_type == 'medicine') {
                  this.eventListQB = this.medicineListWangqi
                }
              } else {
                this.medicineListWangqi = this.medicineListWangqi.concat(res.list);
                this.medicineNoWangqi++;
                if (this.witchGo == 'wangqi' && this.event_type == 'medicine') {
                  this.eventListQB = this.medicineListWangqi
                }
              }
            } else if (this.event_type == 'other') {
              if (this.otherNoWangqi == 1) {
                this.otherListWangqi = res.list;
                this.otherNoWangqi++;
                if (this.witchGo == 'wangqi' && this.event_type == 'other') {
                  this.eventListQB = this.otherListWangqi
                }
              } else {
                this.otherListWangqi = this.otherListWangqi.concat(res.list);
                this.otherNoWangqi++;
                if (this.witchGo == 'wangqi' && this.event_type == 'other') {
                  this.eventListQB = this.otherListWangqi
                }
              }
            }
          }
        })
      },
      witchEvent(e) {
        // this.noMoreEvent = '点击加载更多'
        if (e == 'jinqi') {
          this.witchGo = 'jinqi'
          if (this.event_type == '') {
            this.eventListQB = this.eventListJq
          } else if (this.event_type == 'pool') {
            this.eventListQB = this.poolListJq;
            if (this.poolNoJinqi == 1) {
              this.goEVENT_LIST();
            }
          } else if (this.event_type == 'study') {
            this.eventListQB = this.studyListJq;
            if (this.studyNoJinqi == 1) {
              this.goEVENT_LIST();
            }
          } else if (this.event_type == 'medicine') {
            this.eventListQB = this.medicineListJq;
            if (this.medicineNoJinqi == 1) {
              this.goEVENT_LIST();
            }
          } else if (this.event_type == 'other') {
            this.eventListQB = this.otherListJq;
            if (this.otherNoJinqi == 1) {
              this.goEVENT_LIST();
            }
          }
        } else if (e == 'wangqi') {
          this.witchGo = 'wangqi'
          if (this.event_type == '') {
            this.eventListQB = this.eventListWangqi
            if (this.allNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          } else if (this.event_type == 'pool') {
            this.eventListQB = this.poolListWangqi
            if (this.poolNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          } else if (this.event_type == 'study') {
            this.eventListQB = this.studyListWangqi
            if (this.studyNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          } else if (this.event_type == 'medicine') {
            this.eventListQB = this.medicineListWangqi
            if (this.medicineNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          } else if (this.event_type == 'other') {
            this.eventListQB = this.otherListWangqi
            if (this.otherNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          }
        }
      },
      whichGoMore () {
        this.goSearchPage('all')
//        加载跟多
//        判断执行往期的还是近期的请求
//         if (this.event_type == '') {
//           if (this.witchGo == 'jinqi') {
//             this.allNoJinqi++
//             this.pageNoJinqi = this.allNoJinqi
//             this.goEVENT_LIST()
//           } else if (this.witchGo == 'wangqi') {
// //            this.allNoWangqi++
//             this.pageNoWangqi = this.allNoWangqi
//             this.goEVENT_LISTWq()
//           }
//         } else if (this.event_type == 'pool') {
//           if (this.witchGo == 'jinqi') {
//             this.pageNoJinqi = this.poolNoJinqi
//             this.goEVENT_LIST()
//           } else if (this.witchGo == 'wangqi') {
//             this.pageNoWangqi = this.poolNoWangqi
//             this.goEVENT_LISTWq()
//           }
//         } else if (this.event_type == 'study') {
//           if (this.witchGo == 'jinqi') {
//             this.pageNoJinqi = this.studyNoJinqi
//             this.goEVENT_LIST()
//           } else if (this.witchGo == 'wangqi') {
//             this.pageNoWangqi = this.studyNoWangqi
//             this.goEVENT_LISTWq()
//           }
//         } else if (this.event_type == 'medicine') {
//           if (this.witchGo == 'jinqi') {
//             this.pageNoJinqi = this.medicineNoJinqi
//             this.goEVENT_LIST()
//           } else if (this.witchGo == 'wangqi') {
//             this.pageNoWangqi = this.medicineNoWangqi
//             this.goEVENT_LISTWq()
//           }
//         } else if (this.event_type == 'other') {
//           if (this.witchGo == 'jinqi') {
//             this.pageNoJinqi = this.otherNoJinqi
//             this.goEVENT_LIST()
//           } else if (this.witchGo == 'wangqi') {
//             this.pageNoWangqi = this.otherNoWangqi
//             this.goEVENT_LISTWq()
//           }
//         }
      },
      goProject(e, zi,isTh) {
        // 转到项目详情页
//        let _this = this
        if (zi) {
          let a = e.split('event_id=')[1]
          if (a) {
            window.sessionStorage.setItem('event_id', a)
            if (a == 'eb783144cf9e47f999708a67d48b576d') {
              this.$router.push({path: '/oneToOneMore', query: {'event_id': a}})
            } else {
              this.$router.push({path: '/Project', query: {'event_id': a}})
            }
          }
          return
        }
        if (isTh == 1) {
          window.sessionStorage.setItem('event_id', e)
          this.$router.push({path: '/togetherShop', query: {'event_id': e}})
          return
        }
        this.$router.push({path: '/Project', query: {'event_id': e}})
        window.sessionStorage.setItem('event_id', e)
      },
      changeProjectType(e) {
        // 改变展示的类型
        // this.noMoreEvent = '点击加载更多'
        let _this = this
        if (e == 'quanbu') {
          _this.event_type = ''

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.allNoJinqi
            if (this.allNoJinqi == 1) {
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.eventListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.allNoWangqi
            if (this.allNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.eventListWangqi
            }
          }
          ;

          _this.quanbu = true
          _this.zhukun = false
          _this.zhuxue = false
          _this.zhuyi = false
          _this.qita = false
        } else if (e == 'zhukun') {
          _this.event_type = 'pool';

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.poolNoJinqi
            if (this.poolNoJinqi == 1) {
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.poolListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.poolNoWangqi
            if (this.poolNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.poolListWangqi
            }
          }
          ;
          _this.quanbu = false
          _this.zhukun = true
          _this.zhuxue = false
          _this.zhuyi = false
          _this.qita = false
        } else if (e == 'zhuxue') {
          _this.event_type = 'study'

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.studyNoJinqi
            if (this.studyNoJinqi == 1) {
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.studyListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.studyNoWangqi
            if (this.studyNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.studyListWangqi
            }
          }
          ;

          _this.quanbu = false
          _this.zhukun = false
          _this.zhuxue = true
          _this.zhuyi = false
          _this.qita = false
        } else if (e == 'zhuyi') {
          _this.event_type = 'medicine'

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.medicineNoJinqi
            if (this.medicineNoJinqi == 1) {
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.medicineListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.medicineNoWangqi
            if (this.medicineNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.medicineListWangqi
            }
          }
          ;

          _this.quanbu = false
          _this.zhukun = false
          _this.zhuxue = false
          _this.zhuyi = true
          _this.qita = false
        } else if (e == 'qita') {
          _this.event_type = 'other'

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.otherNoJinqi
            if (this.otherNoJinqi == 1) {
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.otherListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.otherNoWangqi
            if (this.otherNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.otherListWangqi
            }
          }
          ;

          _this.quanbu = false
          _this.zhukun = false
          _this.zhuxue = false
          _this.zhuyi = false
          _this.qita = true
        }
      }
    },
    watch: {
//      通过watch方法去观察index属性的变化，一旦变化让tab选中样式绑定的属性进行反转
      index() {
        let _this = this
        _this.isA = !_this.isA
        _this.isB = !_this.isB
      }
    }
  }
</script>
